/*
 * @(#)BusinessObject.java $version 2010. 8. 11
 *
 * Copyright 2007-2010 NHN Corp. All rights Reserved. 
 * NHN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.nhncorp.usf.core.config.runtime;

import com.nhncorp.usf.core.service.ServiceType;

/**
 * Business 결과를 얻기 위해 수행되어야 하는 {@link Method} 리스트 정보.
 *
 * @author Web Platform Development Team.
 */
public class BusinessObject extends ServiceImpl implements Service {
    /**
     * {@link BusinessObject} 에 대한 식별정보.
     */
    private String id;

    /**
     * 사용할 Connector ID
     */
    private String connectorId;

    private boolean controlBlock = false;

    /**
     * 생성자
     */
    public BusinessObject(String id, boolean controlBlock) {
        this.id = id;
        this.controlBlock = controlBlock;
    }

    /**
     * 생성자
     */
    public BusinessObject(String id) {
        this.id = id;
    }

    /**
     * 생성자
     */
    public BusinessObject() {
    }

    /**
     * {@link BusinessObject} 에 대한 식별정보 반환.
     *
     * @return the bo id
     */
    public String getId() {
        return this.id;
    }

    /**
     * {@link BusinessObject} 에 대한 식별정보 설정.
     *
     * @param id the bo id
     */
    public void setId(String id) {
        this.id = id;
    }

    /**
     * Gets the connector id.
     *
     * @return the connector id
     */
    public String getConnectorId() {
        return connectorId;
    }

    /**
     * Sets the connector id.
     *
     * @param connectorId the new connector id
     */
    public void setConnectorId(String connectorId) {
        this.connectorId = connectorId;
    }

    /**
     * control 내부에 속해있는지 여부 반환.
     * control내부에 속해있을 경우 순차적, 조건부 실행이 가능하다
     *
     * @return boolean the the control block exist or don't exist in service
     */
    public boolean isControlBlock() {
        return controlBlock;
    }

    /**
     * control 내부에 속해있는지 여부 설정
     *
     * @param controlBlock the control block exist or don't exist in service
     */
    public void setControlBlock(boolean controlBlock) {
        this.controlBlock = controlBlock;
    }

    /**
     * Adds the method info. <br/>addServiceInfo 와 동일하다.
     *
     * @param methodInfo the method info
     */
    public void addMethodInfo(Method methodInfo) {
        addServiceInfo(methodInfo);
    }

	@Override
	public ServiceType getServiceType() {
		return ServiceType.bo;
	}
}
